package com.xauto.pioneer.appuser.model;

import org.json.JSONObject;

/**
 * Created by Ellis.Li on 2017/5/12.
 */
public class CarInfo extends BaseModel<CarInfo> {

    /** 车辆ID*/
    public String car_id;
    /** 车辆编号*/
    public String car_no;
    /** 车辆号码*/
    public String plate_no;
    /** 车辆图片*/
    public Image car_image;
    /** 车辆结构名称*/
    public String car_structure_name;
    /** 车辆系列名称*/
    public String car_series_name;
    /** 变速名称*/
    public String transmission_case_type_name;
    /** 车辆颜色名称*/
    public String car_color_name;
    /** 车辆等级*/
    public CarGroupInfo car_goup_info;
    /** 车辆经纬度*/
    public String  car_longitude;
    public String  car_latitude;
    @Override
    public CarInfo parse(JSONObject jsonObject) {
        if(jsonObject != null) {
            car_id = jsonObject.optString("car_id");
            car_no = jsonObject.optString("car_no");
            plate_no = jsonObject.optString("plate_no");
            car_structure_name = jsonObject.optString("car_structure_name");
            car_series_name = jsonObject.optString("car_series_name");
            transmission_case_type_name = jsonObject.optString("transmission_case_type_name");
            car_color_name = jsonObject.optString("car_color_name");
            car_image = new Image().parse(jsonObject.optJSONObject("car_image"));
            car_goup_info = new CarGroupInfo().parse(jsonObject.optJSONObject("car_group_info"));


            car_longitude= jsonObject.optString("car_longitude");
            car_latitude= jsonObject.optString("car_latitude");
            return this;
        }
        return null;
    }
}
